<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
	<meta charset="utf-8">
	<title>注册</title>
	<link rel="stylesheet" type="text/css" href="css/reg.css" />
	<link rel="stylesheet" type="text/css" href="css/re.css" />
	<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
	<script type="text/javascript" src="js/reg.js"></script>
</head>
<body>
<div id="reg">
	<div class="title">注册</div>
	<form method="post"  action="../controls/reg.php">
		<div class="thistext" id="ttext1">
			<a>ID</a>
			<input placeholder="用户名" id="ptext1" class="passtext" required name="userid">
		</div>
		<div class="thistext" id="ttext2" >
			<a>Name</a>
			<input placeholder="姓名" id="ptext2" class="passtext" required name="username">
		</div>
		
		<div class="thistext" id="ttext3" >
			<a>E-mail</a>
			<input placeholder="邮箱" id="ptext3" class="passtext" required name="email" type="email">
		</div>
		<div class="thistext" id="ttext4" >
			<a>Phone</a>
			<input placeholder="手机号码" id="ptext4" class="passtext" required name="phone" type="text">
		</div>
		<div class="thistext" id="ttext5" >
			<a>Class</a>
			<select id="ptext5" class="passtext" name="classid"><?php getclass(); ?></select>
		</div>
		<div class="thistext" id="ttext6" >
			<input name="sbutton" id="button" type="submit" value="提交">
			<input id="button" type="button" value="返回" onclick="location.href='../index.php';">
			
		</div>
	</form>
</div>
</body>
</html>

<?php
	function getclass(){
		require('../controls/connect_sql.php');
		mysql_query('set names utf8');
		$query="select * from class ";
		$result=mysql_query($query)or die (mysql_error());
		while($row=mysql_fetch_array($result)){
			if($row['classid']!=0)
			{
				echo "<option value='".$row['classid']."'>".$row['classname']."</option>";
			}
			

		}

	}
?>